package com.powerbank.common.event.order;

import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 订单归还事件
 */
@Data
public class OrderReturnedEvent {

    /**
     * 订单ID
     */
    private Long orderId;

    /**
     * 订单号
     */
    private String orderNo;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 设备ID
     */
    private Long deviceId;

    /**
     * 实际金额
     */
    private BigDecimal actualAmount;

    /**
     * 创建时间
     */
    private LocalDateTime createdTime;

    public OrderReturnedEvent() {
        this.createdTime = LocalDateTime.now();
    }

    public OrderReturnedEvent(Long orderId, String orderNo, Long userId, Long deviceId, BigDecimal actualAmount) {
        this.orderId = orderId;
        this.orderNo = orderNo;
        this.userId = userId;
        this.deviceId = deviceId;
        this.actualAmount = actualAmount;
        this.createdTime = LocalDateTime.now();
    }
}